{{- range $key, $value := .CandiVersionMap.k8s }}
  {{- $version := toString $key }}
  {{- $image_version := $version | replace "." "-" }}
---
image: {{ $.ModuleName }}/{{ $.ImageName }}-{{ $image_version }}
from: {{ $.Images.BASE_SCRATCH }}
import:
- artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact-{{ $image_version }}
  add: /
  to: /
  includePaths:
  - crictl
  - install
  - uninstall
  before: setup
docker:
  LABEL:
    distro: all
    version: all
    crictl: {{ $version }}
---
artifact: {{ $.ModuleName }}/{{ $.ImageName }}-artifact-{{ $image_version }}
from: {{ $.Images.BASE_GOLANG_20_ALPINE_DEV }}
git:
  - add: /{{ $.ModulePath }}modules/007-{{ $.ModuleName }}/images/{{ $.ImageName }}/scripts
    to: /
    stageDependencies:
      setup:
      - '**/*'
shell:
  setup:
  - export GOPROXY={{ $.GOPROXY }}
  - git clone --depth 1 --branch v{{ $version }}.0 {{ $.SOURCE_REPO }}/kubernetes-sigs/cri-tools.git
  - cd /cri-tools
  - make install crictl
  - mv /usr/local/bin/crictl /crictl
  - chmod +x /crictl /install /uninstall
{{- end }}
